package com.jie.other.compose

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.material.MaterialTheme
import com.jie.other.compose.study04.Study04Page
import com.jie.other.compose.study04.Study04ViewModel
import com.jie.other.compose.study04.details.launchDetails

/**
 * Compose学习第4课
 */
class Study04Activity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val viewModel by viewModels<Study04ViewModel>()
        setContent {
            MaterialTheme {
                Study04Page(
                    viewModel = viewModel,
                    itemClick = {
                        launchDetails(this, it)
                    })
            }
        }
    }
}